<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

<!-- middle -->
<div class="middle myclear">
	<form action="<?php echo site_url('login/?url=' . urlencode($currUrl)); ?>" method="post" id="frmLogin" name="frmLogin" >
		
		
		<div class="login-page lp-vietnam">
			<div class="login-box">
				
				<p class="login-error"><?php echo $error; ?></p>
				
				<p class="login-label">
					<?php echo $login_lang['username']; ?>
				</p>
				<p>
					<input type="text" class="login-input" name="txtUser" id="txtUser" />
				</p>
				<p class="login-label padtop10">
					<?php echo $login_lang['password']; ?>
				</p>
				<p>
					<input type="password" class="login-input" name="txtPass" id="txtPass" />
				</p>
				
				<table class="login-btn-box">
					<tr>
						<td class="ver-middle padright10">
							<img alt="" src="/admin/images/login-btn.gif" class="cursor-pointer" onclick="checkLogin('#txtUser','#txtPass');" />
						</td>
					</tr>
				</table>
			</div>
		</div>
		
	</form>
	
</div> <!-- end middle -->

<script type="text/javascript">
	function checkLogin(uNameID, uPassID)
	{
		if($.trim($(uNameID).val()) == '')
		{
			alert('Please enter username!');
			$(uNameID).val('');
			$(uNameID).focus();
			return false;
		}
		
		if($.trim($(uPassID).val()) == '')
		{
			alert('Please enter password!');
			$(uPassID).val('');
			$(uPassID).focus();
			return false;
		}
		$('#frmLogin').submit();
	}

	function eventLogin(e)
	{
		if(e.keyCode == 13) $('#frmLogin').submit();
	}

	$(document).ready(function(){
		$('#txtUser').keydown(function(event){eventLogin(event);});
		$('#txtPass').keydown(function(event){eventLogin(event);});
		$('#txtUser').focus();
	});
</script>